<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="搬砖 嵌入式">
<meta property="og:type" content="website">
<meta property="og:title" content="学无止境">
<meta property="og:url" content="http://example.com/page/17/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="搬砖 嵌入式">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="xudonglei">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/page/17/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/04/05/3db%E5%B8%A6%E5%AE%BD/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/04/05/3db%E5%B8%A6%E5%AE%BD/" class="post-title-link" itemprop="url">3db带宽</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-04-05 19:59:34" itemprop="dateCreated datePublished" datetime="2022-04-05T19:59:34+08:00">2022-04-05</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E9%9B%B7%E8%BE%BE/" itemprop="url" rel="index"><span itemprop="name">雷达</span></a>
                </span>
            </span>

          
            <span id="/2022/04/05/3db%E5%B8%A6%E5%AE%BD/" class="post-meta-item leancloud_visitors" data-flag-title="3db带宽" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/04/05/3db%E5%B8%A6%E5%AE%BD/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/04/05/3db%E5%B8%A6%E5%AE%BD/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        本文很多内容直接来自于网络，感谢网络上的各位大佬，用的原文链接如下：</p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/u013346007/article/details/51607004">https://blog.csdn.net/u013346007/article/details/51607004</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/gsjthxy/article/details/108116116">https://blog.csdn.net/gsjthxy/article/details/108116116</a></p>
<h3 id="一、基本定义"><a href="#一、基本定义" class="headerlink" title="一、基本定义"></a>一、基本定义</h3><p>​        dB(Decibel，分贝) 是一个纯计数单位，本意是表示两个量的比值大小比较，没有单位。 在工程应用中经常看到貌似不同的定义方式(仅仅是看上去不同)。其实可以分为两类：</p>
<ol>
<li>*<em>对于功率，dB = 10\</em>lg(A/B)**。表明功率A相对于基本功率B的分贝数</li>
<li>*<em>对于电压或电流，dB = 20\</em>lg(A/B)**。表明幅度A相对于基本幅度B的分贝数</li>
</ol>
<p>​        天线增益显然可以描述成输出电压与输入感应电压之比,可以采用分贝(dB)描述,还有声强也使用分贝描述。实际上，电路的放大倍数、衰减率、传输系数.都是使用分贝描述。</p>
<h3 id="二、3db带宽定义"><a href="#二、3db带宽定义" class="headerlink" title="二、3db带宽定义"></a>二、3db带宽定义</h3><p>​    -3dB带宽指幅值等于最大值的二分之根号二倍时对应的频带宽度。这个3分贝是多大呢？</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202204042009120.png" style="zoom:67%;">

<p><strong>由10log（1/2）=-3.0103</strong>，可知，这时的输出功率是输入功率的1/2。</p>
<p>{</p>
<p>|* 例：滤波器是有损耗的（它不是放大器，所以，输出功率一定小于输入功率）。称为插入损耗。<br>|* 这个损耗的大小是多少？<br>|* =20<em>log(Uo/Ui)<br>|</em> 上式中，Uo是输出电压，Ui是输入电压，两者的比值取对数再乘以20，称为“分贝”，记作：dB。</p>
<p>|* 若是用输出功率与输入功率比，就是下式：<br>|* 损耗分贝数=10<em>log(Po/Pi)<br>|</em> Po是输出功率，Pi是输入功率。</p>
<p>}</p>
<p>​        辐值的平方即为功率，平方后变为<em>1/2</em>倍，在对数坐标中就是*-3dB*的位置了，也就是半功率点了，对应的带宽就是功率在减少至其一半以前的频带宽度，表示在该带宽内集中了一半的功率。</p>
<p>​        3dB–指的是比峰值功率小3dB（就是峰值的50％）的频谱范围的带宽。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/04/03/74HC595%E4%BD%BF%E7%94%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/04/03/74HC595%E4%BD%BF%E7%94%A8/" class="post-title-link" itemprop="url">74HC595使用</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-04-03 09:22:26" itemprop="dateCreated datePublished" datetime="2022-04-03T09:22:26+08:00">2022-04-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%A1%AC%E4%BB%B6/" itemprop="url" rel="index"><span itemprop="name">硬件</span></a>
                </span>
            </span>

          
            <span id="/2022/04/03/74HC595%E4%BD%BF%E7%94%A8/" class="post-meta-item leancloud_visitors" data-flag-title="74HC595使用" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/04/03/74HC595%E4%BD%BF%E7%94%A8/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/04/03/74HC595%E4%BD%BF%E7%94%A8/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        用到的原文链接：<a target="_blank" rel="noopener" href="https://www.i4k.xyz/article/u013978070/120934160">https://www.i4k.xyz/article/u013978070/120934160</a></p>
<p>​                                      <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_41445387/article/details/80500046">https://blog.csdn.net/weixin_41445387/article/details/80500046</a></p>
<p>​        74HC595是一种8位串行输入，并行输出的寄存器芯片，一共有16个引脚，如下图。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202204030925673.png" style="zoom:67%;">

<p>​        各引脚功能如下所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202204030931458.png" style="zoom:67%;">

<p>​        这里面比较需要理解的是11、12引脚，对照功能描述，可以知道595芯片里面有2个8位寄存器：移位寄存器（Shift regisiter）、存储寄存器(Storage register)。移位就像压数据入一个仓库里，当一个新的位数据要进来时，已经进入的位数据就在移位寄存器时钟脉冲的控制下（即11脚），整体后移，让出位置。数据从位移寄存器转移到存储寄存器，也是需要时钟脉冲驱动的，这就是12脚的作用。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202204030934300.png" style="zoom:50%;">

<p>​        怎么将移位寄存器的数据转移到存储寄存器存储寄存器是直接和8个输出引脚相通的，将移位寄存器的数据转移到存储寄存器后，Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 就可以接受带到我们开始输入的一个字节的数据。所谓存储寄存器，就是数据可以存在这个寄存器中，并不会随着一次输出就消失，只要595不断电，也没有新的数据从移位寄存器中过来，数据就一直不变且有效。新的数据过来后，存储寄存器中的数据就会被覆盖更新。</p>
<p>​        数据从位移寄存器转移到存储寄存器，也是需要时钟脉冲驱动的，这就是12脚的作用。它也是上升沿有效。</p>
<p>​        13脚OE  输出使能控制脚，如果它不工作，那么595的输出就是高阻态，595就不受我们程序控制了，这显然违背我们的意愿。OE的上面画了一条线，表示他是低电平有效。于是我们将他接GND。</p>
<p>​        10脚MR ，位移寄存器清空脚，他的作用就是将位移寄存器中的数据全部清空，这个很少用到，所以我们一般不让他起作用，他也是低电平有效，于是我们给他接VCC。</p>
<p><strong>级联情况：</strong></p>
<p>​        如果要让2个595串联起来的话，就需要9脚。想一下，我们将移位寄存器的8个位填满后，再往移位寄存器中塞一个会怎么样？也许你想到了。对！移位寄存器的最后一个位数据会被挤出去，从哪里出去？就是从9脚输出的。如果我们把第一个595的9脚连接到第二个的串行数据输入脚，那么，就形成了595的级联。这样，如果我们用2个595组合成了一个新的超级595，这个草鸡595的移位寄存器和存储寄存器的容量都翻倍了，1口控制16口，有木有！你还可以继续级联下去！</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/04/02/CMSIS%20DSP%E5%BA%93%E5%90%84%E5%87%BD%E6%95%B0%E8%AE%A1%E7%AE%97%E6%97%B6%E9%97%B4%E5%AE%9E%E6%B5%8B%E7%BB%9F%E8%AE%A1%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%E4%B8%AD/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/04/02/CMSIS%20DSP%E5%BA%93%E5%90%84%E5%87%BD%E6%95%B0%E8%AE%A1%E7%AE%97%E6%97%B6%E9%97%B4%E5%AE%9E%E6%B5%8B%E7%BB%9F%E8%AE%A1%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%E4%B8%AD/" class="post-title-link" itemprop="url">CMSIS DSP库各函数计算时间实测统计持续更新中</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-04-02 13:03:23" itemprop="dateCreated datePublished" datetime="2022-04-02T13:03:23+08:00">2022-04-02</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2022/04/02/CMSIS%20DSP%E5%BA%93%E5%90%84%E5%87%BD%E6%95%B0%E8%AE%A1%E7%AE%97%E6%97%B6%E9%97%B4%E5%AE%9E%E6%B5%8B%E7%BB%9F%E8%AE%A1%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%E4%B8%AD/" class="post-meta-item leancloud_visitors" data-flag-title="CMSIS DSP库各函数计算时间实测统计持续更新中" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/04/02/CMSIS%20DSP%E5%BA%93%E5%90%84%E5%87%BD%E6%95%B0%E8%AE%A1%E7%AE%97%E6%97%B6%E9%97%B4%E5%AE%9E%E6%B5%8B%E7%BB%9F%E8%AE%A1%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%E4%B8%AD/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/04/02/CMSIS%20DSP%E5%BA%93%E5%90%84%E5%87%BD%E6%95%B0%E8%AE%A1%E7%AE%97%E6%97%B6%E9%97%B4%E5%AE%9E%E6%B5%8B%E7%BB%9F%E8%AE%A1%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%E4%B8%AD/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h3 id="一，stm32F429平台，使能FPU"><a href="#一，stm32F429平台，使能FPU" class="headerlink" title="一，stm32F429平台，使能FPU"></a><strong>一，stm32F429平台，使能FPU</strong></h3><p><strong>1.64点浮点fft</strong></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">arm_cfft_f32(&amp;arm_cfft_sR_f32_len64,  (<span class="keyword">float32_t</span> *) dfftTmp1,<span class="number">0</span>,<span class="number">1</span>);</span><br><span class="line">arm_cfft_f32(&amp;arm_cfft_sR_f32_len64,  (<span class="keyword">float32_t</span> *) dfftTmp2,<span class="number">0</span>,<span class="number">1</span>);</span><br></pre></td></tr></table></figure>
<p>两行运行：<strong>53us</strong></p>
<p><strong>2.求距离</strong></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">float32_t</span> PA[<span class="number">2</span>];</span><br><span class="line"><span class="keyword">float32_t</span> PB[<span class="number">2</span>];</span><br><span class="line">		</span><br><span class="line">PA[<span class="number">0</span>] = <span class="number">-30</span>;</span><br><span class="line">PA[<span class="number">1</span>] = <span class="number">5</span>;</span><br><span class="line">PB[<span class="number">0</span>] = <span class="number">7</span>;</span><br><span class="line">PB[<span class="number">1</span>] = <span class="number">10</span>;</span><br><span class="line">		</span><br><span class="line"><span class="keyword">float32_t</span> PC = <span class="number">0</span>;</span><br><span class="line">PC = arm_euclidean_distance_f32(PA, PB, <span class="number">2</span>);	</span><br></pre></td></tr></table></figure>
<p>执行1000000次，需要616ms</p>
<p><strong>3.使用cordic算法思想计算浮点数的log10对数</strong></p>
<p><a target="_blank" rel="noopener" href="https://download.csdn.net/download/shenbuzhi/10220556?utm_medium=distribute.pc_aggpage_search_result.none-task-download-2~aggregatepage~first_rank_ecpm_v1~rank_v31_ecpm-6-10220556.pc_agg_new_rank&amp;utm_term=stm32+%E5%AF%B9%E6%95%B0%E8%BF%90%E7%AE%97&amp;spm=1000.2123.3001.4430">https://download.csdn.net/download/shenbuzhi/10220556?utm_medium=distribute.pc_aggpage_search_result.none-task-download-2~aggregatepage~first_rank_ecpm_v1~rank_v31_ecpm-6-10220556.pc_agg_new_rank&amp;utm_term=stm32+%E5%AF%B9%E6%95%B0%E8%BF%90%E7%AE%97&amp;spm=1000.2123.3001.4430</a></p>
<p>执行1000000次，需要268ms</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/04/01/python%20wrapper%20for%20dsp/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/04/01/python%20wrapper%20for%20dsp/" class="post-title-link" itemprop="url">python wrapper for dsp</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-04-01 17:53:38" itemprop="dateCreated datePublished" datetime="2022-04-01T17:53:38+08:00">2022-04-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2022/04/01/python%20wrapper%20for%20dsp/" class="post-meta-item leancloud_visitors" data-flag-title="python wrapper for dsp" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/04/01/python%20wrapper%20for%20dsp/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/04/01/python%20wrapper%20for%20dsp/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h3 id="一、编译安装"><a href="#一、编译安装" class="headerlink" title="一、编译安装"></a>一、编译安装</h3><p>1.CMSIS DSP wrapper使用了numpy，所以要先安装好numpy。</p>
<p>2.到CMSIS/DSP/PythonWrapper目录下，执行：python setup.py build_ext –inplace</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220331105244.png" style="zoom:80%;">

<p>编译成功后如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220331105351.png" style="zoom:80%;">

<p>记住要安装提前安装vs2017 C/C++有关的东西，如下图，否则编译出错。我一开始电脑里已经安装了vs2019，但是编译没成功，后来我卸载了vs2019，重新安装了vs2017就可以了，很奇怪。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220331105511.png" style="zoom:67%;">

<p>3.上面第二步并不是安装cmsisdsp包，但这一步很重要，可以确保build成功。如果要安装cmsisdsp包，执行下面两行命令即可。</p>
<p>python setup.py  build</p>
<p>python setup.py  install</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331111240.png"></p>
<h3 id="二、实例尝试"><a href="#二、实例尝试" class="headerlink" title="二、实例尝试"></a>二、实例尝试</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> cmsisdsp <span class="keyword">as</span> dsp</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">realToIm1D</span>(<span class="params">ar</span>):</span></span><br><span class="line">    <span class="keyword">return</span> (ar[<span class="number">0</span>::<span class="number">2</span>] + <span class="number">1j</span> * ar[<span class="number">1</span>::<span class="number">2</span>])</span><br><span class="line"></span><br><span class="line">a_in = np.array([<span class="number">0</span>, <span class="number">256</span>,</span><br><span class="line">                 -<span class="number">320</span>, <span class="number">448</span>,</span><br><span class="line">                 -<span class="number">576</span>, <span class="number">640</span>,</span><br><span class="line">                 <span class="number">1024</span>, <span class="number">960</span>,</span><br><span class="line">                 -<span class="number">192</span>, <span class="number">0</span>,</span><br><span class="line">                 -<span class="number">256</span>, -<span class="number">256</span>,</span><br><span class="line">                 <span class="number">192</span>, <span class="number">320</span>,</span><br><span class="line">                 <span class="number">128</span>, <span class="number">704</span>,</span><br><span class="line">                 <span class="number">0</span>, <span class="number">384</span>,</span><br><span class="line">                 -<span class="number">192</span>, -<span class="number">256</span>,</span><br><span class="line">                 <span class="number">384</span>, <span class="number">64</span>,</span><br><span class="line">                 -<span class="number">64</span>, -<span class="number">384</span>,</span><br><span class="line">                 -<span class="number">64</span>, -<span class="number">128</span>,</span><br><span class="line">                 <span class="number">256</span>, <span class="number">128</span>,</span><br><span class="line">                 <span class="number">704</span>, <span class="number">0</span>,</span><br><span class="line">                 -<span class="number">192</span>, -<span class="number">192</span>,</span><br><span class="line">                 -<span class="number">64</span>, <span class="number">192</span>,</span><br><span class="line">                 -<span class="number">192</span>, <span class="number">384</span>,</span><br><span class="line">                 <span class="number">128</span>, <span class="number">64</span>,</span><br><span class="line">                 <span class="number">192</span>, -<span class="number">768</span>,</span><br><span class="line">                 -<span class="number">320</span>, -<span class="number">192</span>,</span><br><span class="line">                 -<span class="number">448</span>, <span class="number">256</span>,</span><br><span class="line">                 -<span class="number">128</span>, <span class="number">320</span>,</span><br><span class="line">                 <span class="number">384</span>, <span class="number">384</span>,</span><br><span class="line">                 <span class="number">192</span>, <span class="number">576</span>,</span><br><span class="line">                 <span class="number">192</span>, <span class="number">448</span>,</span><br><span class="line">                 <span class="number">64</span>, <span class="number">320</span>,</span><br><span class="line">                 -<span class="number">192</span>, -<span class="number">64</span>,</span><br><span class="line">                 <span class="number">64</span>, <span class="number">448</span>,</span><br><span class="line">                 <span class="number">64</span>, <span class="number">192</span>,</span><br><span class="line">                 <span class="number">256</span>, <span class="number">128</span>,</span><br><span class="line">                 <span class="number">512</span>, <span class="number">512</span>,</span><br><span class="line">                 <span class="number">256</span>, -<span class="number">1088</span>,</span><br><span class="line">                 -<span class="number">704</span>, -<span class="number">128</span>,</span><br><span class="line">                 -<span class="number">512</span>, <span class="number">320</span>,</span><br><span class="line">                 -<span class="number">128</span>, -<span class="number">64</span>,</span><br><span class="line">                 <span class="number">192</span>, -<span class="number">320</span>,</span><br><span class="line">                 <span class="number">128</span>, -<span class="number">320</span>,</span><br><span class="line">                 <span class="number">0</span>, <span class="number">256</span>,</span><br><span class="line">                 -<span class="number">64</span>, -<span class="number">192</span>,</span><br><span class="line">                 <span class="number">128</span>, -<span class="number">64</span>,</span><br><span class="line">                 <span class="number">64</span>, <span class="number">256</span>,</span><br><span class="line">                 -<span class="number">512</span>, -<span class="number">256</span>,</span><br><span class="line">                 <span class="number">192</span>, -<span class="number">384</span>,</span><br><span class="line">                 <span class="number">512</span>, -<span class="number">128</span>,</span><br><span class="line">                 -<span class="number">320</span>, -<span class="number">128</span>,</span><br><span class="line">                 -<span class="number">192</span>, -<span class="number">192</span>,</span><br><span class="line">                 <span class="number">320</span>, <span class="number">320</span>,</span><br><span class="line">                 -<span class="number">192</span>, -<span class="number">192</span>,</span><br><span class="line">                 -<span class="number">576</span>, <span class="number">256</span>,</span><br><span class="line">                 <span class="number">0</span>, -<span class="number">256</span>,</span><br><span class="line">                 -<span class="number">320</span>, -<span class="number">320</span>,</span><br><span class="line">                 -<span class="number">384</span>, <span class="number">192</span>,</span><br><span class="line">                 -<span class="number">256</span>, -<span class="number">448</span>,</span><br><span class="line">                 -<span class="number">640</span>, <span class="number">1024</span>,</span><br><span class="line">                 <span class="number">0</span>, <span class="number">0</span>,</span><br><span class="line">                 -<span class="number">704</span>, -<span class="number">384</span>,</span><br><span class="line">                 -<span class="number">192</span>, <span class="number">384</span>,</span><br><span class="line">                 -<span class="number">384</span>, -<span class="number">64</span>,</span><br><span class="line">                 -<span class="number">64</span>, -<span class="number">256</span>,</span><br><span class="line">                 -<span class="number">384</span>, <span class="number">64</span>,</span><br><span class="line">                 -<span class="number">256</span>, <span class="number">256</span>,</span><br><span class="line">                 <span class="number">0</span>, <span class="number">192</span>,</span><br><span class="line">                 -<span class="number">1152</span>, -<span class="number">64</span>, ])</span><br><span class="line"><span class="comment"># ar = realToIm1D(a)</span></span><br><span class="line"><span class="comment"># print(ar)</span></span><br><span class="line">cfftq31 = dsp.arm_cfft_instance_q31()</span><br><span class="line">status = dsp.arm_cfft_init_q31(cfftq31, <span class="number">64</span>)</span><br><span class="line">print(status)</span><br><span class="line">resultR = dsp.arm_cfft_q31(cfftq31, a_in, <span class="number">0</span>, <span class="number">1</span>)</span><br><span class="line">print(resultR)</span><br></pre></td></tr></table></figure>
<p>这个计算结果和C工程里调用cmsis dsp的结果完全一致。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220331153932.png" style="zoom:80%;">

<h3 id="三、卸载"><a href="#三、卸载" class="headerlink" title="三、卸载"></a>三、卸载</h3><p>​        有时候想换更高版本的cmsis dsp库，就需要卸载之前安装的包。使用python setup.py  install安装的包卸载方式不太一样，可以按下面的步骤来。</p>
<p>​        先再次使用：python setup.py install –record logName</p>
<p>​        这样在logName的这个文件里面会写清楚安装包的具体路径，如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220415205016.png" style="zoom:67%;">

<p>直接把这个路径里的文件删除就可以了。</p>
<h3 id="四、遇到有个函数不能使用的问题"><a href="#四、遇到有个函数不能使用的问题" class="headerlink" title="四、遇到有个函数不能使用的问题"></a>四、遇到有个函数不能使用的问题</h3><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220419174128.png" style="zoom:67%;">

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/29/%E4%BB%8E%E7%9B%B8%E4%BD%8D%E5%B7%AE%E5%88%B0%E5%AF%BC%E5%90%91%E7%9F%A2%E9%87%8F/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/03/29/%E4%BB%8E%E7%9B%B8%E4%BD%8D%E5%B7%AE%E5%88%B0%E5%AF%BC%E5%90%91%E7%9F%A2%E9%87%8F/" class="post-title-link" itemprop="url">从相位差到导向矢量</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-29 23:01:32" itemprop="dateCreated datePublished" datetime="2022-03-29T23:01:32+08:00">2022-03-29</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E9%9B%B7%E8%BE%BE/" itemprop="url" rel="index"><span itemprop="name">雷达</span></a>
                </span>
            </span>

          
            <span id="/2022/03/29/%E4%BB%8E%E7%9B%B8%E4%BD%8D%E5%B7%AE%E5%88%B0%E5%AF%BC%E5%90%91%E7%9F%A2%E9%87%8F/" class="post-meta-item leancloud_visitors" data-flag-title="从相位差到导向矢量" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/29/%E4%BB%8E%E7%9B%B8%E4%BD%8D%E5%B7%AE%E5%88%B0%E5%AF%BC%E5%90%91%E7%9F%A2%E9%87%8F/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/29/%E4%BB%8E%E7%9B%B8%E4%BD%8D%E5%B7%AE%E5%88%B0%E5%AF%BC%E5%90%91%E7%9F%A2%E9%87%8F/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        本文很多内容直接来自于网络，感谢网络上的各位大佬，用的原文链接如下：</p>
<p><a target="_blank" rel="noopener" href="https://www.zhihu.com/question/31104681">https://www.zhihu.com/question/31104681</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/iiiliuyang/article/details/109265796">https://blog.csdn.net/iiiliuyang/article/details/109265796</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/pwang95/article/details/104999880?spm=1001.2014.3001.5502">https://blog.csdn.net/pwang95/article/details/104999880?spm=1001.2014.3001.5502</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/pwang95/article/details/106060708">https://blog.csdn.net/pwang95/article/details/106060708</a></p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_42165580/article/details/107600295">https://blog.csdn.net/weixin_42165580/article/details/107600295</a></p>
<p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/446758808">https://zhuanlan.zhihu.com/p/446758808</a></p>
<h3 id="一、相位概念"><a href="#一、相位概念" class="headerlink" title="一、相位概念"></a>一、相位概念</h3><p>​        相位（phase）是对于一个波，特定的时刻在它循环中的位置：一种它是否在波峰、波谷或它们之间的某点的标度 。相位描述信号波形变化的度量，通常以度 （角度）作为单位，也称作相角。 当信号波形以周期的方式变化，波形循环一周即为360°</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292309460.png" style="zoom:30%;">

<h3 id="二、相位差"><a href="#二、相位差" class="headerlink" title="二、相位差"></a>二、相位差</h3><p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292320764.png"></p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292324850.png"></p>
<h3 id="三、导向矢量"><a href="#三、导向矢量" class="headerlink" title="三、导向矢量"></a>三、导向矢量</h3><p>​    <strong>导向矢量的本质是描述空间相位差的</strong>。</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292330708.png"></p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292331074.png"></p>
<h3 id="四、整理的一些说明"><a href="#四、整理的一些说明" class="headerlink" title="四、整理的一些说明"></a>四、整理的一些说明</h3><p>​        从上面可以看到导向矢量表达式里面有e的负j多少次方来着，可能一下子不知道这个是怎么来的，看看下面这个图。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292337267.png" style="zoom:53%;">

<p>因为一般来说都是认为相位变换是顺时针的，所以加一个负号e(-jwt)。</p>
<p>另外导向矢量怎么突然联系上了欧拉公式，看下面：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203292345067.png" style="zoom:80%;">

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/21/python%E6%89%93%E5%8D%B0%E5%90%84%E7%A7%8D%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%95%B0%E6%8D%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/03/21/python%E6%89%93%E5%8D%B0%E5%90%84%E7%A7%8D%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%95%B0%E6%8D%AE/" class="post-title-link" itemprop="url">python打印各种格式的数据</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-21 20:31:29" itemprop="dateCreated datePublished" datetime="2022-03-21T20:31:29+08:00">2022-03-21</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2022/03/21/python%E6%89%93%E5%8D%B0%E5%90%84%E7%A7%8D%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%95%B0%E6%8D%AE/" class="post-meta-item leancloud_visitors" data-flag-title="python打印各种格式的数据" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/21/python%E6%89%93%E5%8D%B0%E5%90%84%E7%A7%8D%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%95%B0%E6%8D%AE/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/21/python%E6%89%93%E5%8D%B0%E5%90%84%E7%A7%8D%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%95%B0%E6%8D%AE/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h3 id="以16进制打印数据"><a href="#以16进制打印数据" class="headerlink" title="以16进制打印数据"></a><strong>以16进制打印数据</strong></h3><p><strong>正数：</strong></p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220321203434.png"></p>
<p><strong>负数：</strong></p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220321203536.png" style="zoom:67%;">


      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/19/stm32f103%E6%A0%87%E5%87%86%E5%BA%93%E7%A7%BB%E6%A4%8DRT-Thread%20Nano%203.1.5/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/03/19/stm32f103%E6%A0%87%E5%87%86%E5%BA%93%E7%A7%BB%E6%A4%8DRT-Thread%20Nano%203.1.5/" class="post-title-link" itemprop="url">stm32f103标准库移植RT-Thread Nano 3.1.5</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-19 17:06:30" itemprop="dateCreated datePublished" datetime="2022-03-19T17:06:30+08:00">2022-03-19</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2022/03/19/stm32f103%E6%A0%87%E5%87%86%E5%BA%93%E7%A7%BB%E6%A4%8DRT-Thread%20Nano%203.1.5/" class="post-meta-item leancloud_visitors" data-flag-title="stm32f103标准库移植RT-Thread Nano 3.1.5" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/19/stm32f103%E6%A0%87%E5%87%86%E5%BA%93%E7%A7%BB%E6%A4%8DRT-Thread%20Nano%203.1.5/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/19/stm32f103%E6%A0%87%E5%87%86%E5%BA%93%E7%A7%BB%E6%A4%8DRT-Thread%20Nano%203.1.5/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    参考资料：<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_50554488/article/details/121581457">https://blog.csdn.net/weixin_50554488/article/details/121581457</a></p>
<p>​                        <a target="_blank" rel="noopener" href="https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-nano/nano-port-keil/an0039-nano-port-keil">https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-nano/nano-port-keil/an0039-nano-port-keil</a></p>
<ol>
<li><p>准备一个正常用的stm32f103的标准库工程。</p>
</li>
<li><p>下载Rt-thread nano离线包，下载后双击一路安装即可。</p>
</li>
<li><p>打开要修改的标准库工程，点击Manager Run-Time Environment，只勾选kernel后点击OK。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203191711961.png" style="zoom:67%;">

<p>4.下载rtthread nano源码，<a target="_blank" rel="noopener" href="https://github.com/RT-Thread/rtthread-nano">下载地址</a> 。解压打开后，找到board.c文件，将内容复制到自己工程下的board.c即可。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203191715040.png" style="zoom:67%;">

</li>
</ol>
<p>5.编译自己的工程，正常应该会发现三个error,所以把stm32f10x.it.c中的三个重复定义的函数注销掉</p>
<p>分别是：RendSV_Handler，SysTick_Handler和HardFault_Handler</p>
<p>6.现在就可以编写一个简单应用了。</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;stm32f10x.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;led.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;rtthread.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span></span></span><br><span class="line"><span class="function"></span>&#123;	</span><br><span class="line">	  LED_Init();</span><br><span class="line">	</span><br><span class="line">		<span class="keyword">while</span> (<span class="number">1</span>)</span><br><span class="line">		&#123;	</span><br><span class="line">			  LED_Heart_Toggle();</span><br><span class="line">			  LED_Rx_Toggle();</span><br><span class="line">			  rt_thread_mdelay(<span class="number">1000</span>);</span><br><span class="line">		&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>​        注：当添加 RT-Thread 之后，裸机中的 main() 函数会自动变成 RT-Thread 系统中 main 线程的入口函数。由于线程不能一直独占 CPU，所以此时在 main() 中使用 while(1) 时，需要有让出 CPU 的动作，比如使用 rt_thread_mdelay() 系列的函数让出 CPU。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/18/STM32F429%E5%BC%80%E5%90%AFFPU%E5%8A%A0%E9%80%9F%E6%B5%8B%E8%AF%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/03/18/STM32F429%E5%BC%80%E5%90%AFFPU%E5%8A%A0%E9%80%9F%E6%B5%8B%E8%AF%95/" class="post-title-link" itemprop="url">STM32F429开启FPU加速测试</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-18 10:45:03" itemprop="dateCreated datePublished" datetime="2022-03-18T10:45:03+08:00">2022-03-18</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2022/03/18/STM32F429%E5%BC%80%E5%90%AFFPU%E5%8A%A0%E9%80%9F%E6%B5%8B%E8%AF%95/" class="post-meta-item leancloud_visitors" data-flag-title="STM32F429开启FPU加速测试" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/18/STM32F429%E5%BC%80%E5%90%AFFPU%E5%8A%A0%E9%80%9F%E6%B5%8B%E8%AF%95/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/18/STM32F429%E5%BC%80%E5%90%AFFPU%E5%8A%A0%E9%80%9F%E6%B5%8B%E8%AF%95/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p><strong>1.Arm compiler5，不开启FPU,测试浮点乘法</strong></p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220318142305.png" style="zoom:67%;">

<p><strong>红框处不能省略，否则时间测的不准。</strong></p>
<p>运算时间：<strong>422ms</strong></p>
<p><strong>2.Arm compiler5，开启FPU,测试浮点乘法</strong></p>
<p>但是我那边C/C++里面没设置那些宏也是默认开启了FPU的。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220318132931.png" style="zoom:67%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20220318132949.png" style="zoom:67%;">

<p>运算时间：<strong>77.6ms</strong></p>
<p><strong>3.64点浮点fft</strong></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">arm_cfft_f32(&amp;arm_cfft_sR_f32_len64,  (<span class="keyword">float32_t</span> *) dfftTmp1,<span class="number">0</span>,<span class="number">1</span>);</span><br><span class="line">arm_cfft_f32(&amp;arm_cfft_sR_f32_len64,  (<span class="keyword">float32_t</span> *) dfftTmp2,<span class="number">0</span>,<span class="number">1</span>);</span><br></pre></td></tr></table></figure>
<p>F429上运行：<strong>53us</strong></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/16/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E5%AE%9E%E6%88%98/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/03/16/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E5%AE%9E%E6%88%98/" class="post-title-link" itemprop="url">FIR滤波器实战</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-16 20:57:32" itemprop="dateCreated datePublished" datetime="2022-03-16T20:57:32+08:00">2022-03-16</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%AE%97%E6%B3%95/" itemprop="url" rel="index"><span itemprop="name">算法</span></a>
                </span>
            </span>

          
            <span id="/2022/03/16/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E5%AE%9E%E6%88%98/" class="post-meta-item leancloud_visitors" data-flag-title="FIR滤波器实战" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/16/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E5%AE%9E%E6%88%98/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/16/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E5%AE%9E%E6%88%98/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        这边使用一个具体例子来直观感受一下FIR滤波器的作用，这里使用正点原子的潘多拉开发板，上面有个六轴传感器，我让它输出x轴的加速度值以及经过滤波后的x轴加速度值。本来还准备写个上位机工具，把两者的曲线画出来对比滤波前后的效果，但考虑到匿名四轴上位机有波形显示的功能，那直接用现成的就可以了。</p>
<h3 id="一、代码修改的地方"><a href="#一、代码修改的地方" class="headerlink" title="一、代码修改的地方"></a><strong>一、代码修改的地方</strong></h3><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">usart1_niming_report</span><span class="params">(u8 fun,u8*data,u8 len)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	u8 send_buf[<span class="number">32</span>];</span><br><span class="line">    u8 i;</span><br><span class="line">    <span class="keyword">if</span>(len&gt;<span class="number">28</span>)<span class="keyword">return</span>;  </span><br><span class="line">    send_buf[len+<span class="number">3</span>]=<span class="number">0</span>; </span><br><span class="line">    send_buf[<span class="number">0</span>]=<span class="number">0X88</span>;  </span><br><span class="line">    send_buf[<span class="number">1</span>]=fun;    </span><br><span class="line">    send_buf[<span class="number">2</span>]=len;   </span><br><span class="line">    <span class="keyword">for</span>(i=<span class="number">0</span>;i&lt;len;i++)send_buf[<span class="number">3</span>+i]=data[i];        </span><br><span class="line">    <span class="keyword">for</span>(i=<span class="number">0</span>;i&lt;len+<span class="number">3</span>;i++)send_buf[len+<span class="number">3</span>]+=send_buf[i];   </span><br><span class="line">    <span class="keyword">for</span>(i=<span class="number">0</span>;i&lt;len+<span class="number">4</span>;i++)usart1_send_char(send_buf[i]);   </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">icm20608_send_accx</span><span class="params">(<span class="keyword">short</span> aacx,<span class="keyword">short</span> aacxfilter)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	u8 tbuf[<span class="number">4</span>]; </span><br><span class="line">	tbuf[<span class="number">0</span>]=(aacx&gt;&gt;<span class="number">8</span>)&amp;<span class="number">0XFF</span>;</span><br><span class="line">	tbuf[<span class="number">1</span>]=aacx&amp;<span class="number">0XFF</span>;</span><br><span class="line">	tbuf[<span class="number">2</span>]=(aacxfilter&gt;&gt;<span class="number">8</span>)&amp;<span class="number">0XFF</span>;</span><br><span class="line">	tbuf[<span class="number">3</span>]=aacxfilter&amp;<span class="number">0XFF</span>;</span><br><span class="line">	usart1_niming_report(<span class="number">0XA8</span>,tbuf,<span class="number">4</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">FIRFilter accXFilter;</span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    .......</span><br><span class="line">    ICM20608_Init();			</span><br><span class="line">    FIRFilter_Init(&amp;accXFilter);</span><br><span class="line">    <span class="keyword">while</span>(<span class="number">1</span>)</span><br><span class="line">    &#123; </span><br><span class="line">        <span class="keyword">if</span>(mpu_mpl_get_data(&amp;pitch,&amp;roll,&amp;yaw)==<span class="number">0</span>)</span><br><span class="line">        &#123;</span><br><span class="line">			MPU_Get_Accelerometer(&amp;aacx,&amp;aacy,&amp;aacz);	</span><br><span class="line">			FIRFilter_Update(&amp;accXFilter, aacx);</span><br><span class="line">						</span><br><span class="line">		    icm20608_send_accx(aacx, accXFilter.out);</span><br><span class="line">		&#125;</span><br><span class="line">		delay_ms(<span class="number">100</span>);</span><br><span class="line">	 &#125; 	    	</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>其中FIRFilter相关的代码可以参考之前的博文：<a target="_blank" rel="noopener" href="https://xudonglei.gitee.io/2022/03/09/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E7%AE%80%E4%BB%8B%E4%BA%8C(%E4%B8%8A%E4%BB%A3%E7%A0%81)/">https://xudonglei.gitee.io/2022/03/09/FIR%E6%BB%A4%E6%B3%A2%E5%99%A8%E7%AE%80%E4%BB%8B%E4%BA%8C(%E4%B8%8A%E4%BB%A3%E7%A0%81)/</a></p>
<h3 id="二、匿名四轴上位机的使用"><a href="#二、匿名四轴上位机的使用" class="headerlink" title="二、匿名四轴上位机的使用"></a>二、匿名四轴上位机的使用</h3><p>1.先设置串口，波特率啥的</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162140852.png" style="zoom:47%;">

<p>2.使用高级收码功能</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162143830.png" style="zoom:67%;">

<p>​        根据下位机发送的功能帧来选择这边的帧，我固件中功能帧是0xA8，所以上位机里面相应的选择第8个tab，同时开关和显示都打勾记得。</p>
<p>​        因为我需要查看2个数据，accx和accXFilter，它们正好是数据帧的中的第一个和第二个数据，并且他们都是short类型，所以如下图这样设置。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162149761.png" style="zoom:67%;">

<p>​        波形显示的时候需要像下面这样设置，<strong>下面图中“数据设置”那边的1-20序号对应的是波形序号</strong>，也就是说最多能指定20个波形，我们这里有accx和accXFilter两个波形，所以设置1和2。</p>
<p>​        设置一个波形1，它的值来源于数据帧8的第一位。</p>
<p>​        设置一个波形2，它的值来源于数据帧8的第二位。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162252899.png" style="zoom:50%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162255533.png" style="zoom:50%;">

<p>​        打开波形显示页面，把第一个和第二个Series打勾即可。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162257234.png" style="zoom:70%;">

<h3 id="三、运行效果"><a href="#三、运行效果" class="headerlink" title="三、运行效果"></a>三、运行效果</h3><p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203162302920.gif"></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/10/Matlab%20filterDesigner%E5%B7%A5%E5%85%B7%E7%94%9F%E6%88%90FIR%E6%BB%A4%E6%B3%A2%E5%99%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/03/10/Matlab%20filterDesigner%E5%B7%A5%E5%85%B7%E7%94%9F%E6%88%90FIR%E6%BB%A4%E6%B3%A2%E5%99%A8/" class="post-title-link" itemprop="url">Matlab filterDesigner工具生成FIR滤波器</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-10 21:48:49" itemprop="dateCreated datePublished" datetime="2022-03-10T21:48:49+08:00">2022-03-10</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%AE%97%E6%B3%95/" itemprop="url" rel="index"><span itemprop="name">算法</span></a>
                </span>
            </span>

          
            <span id="/2022/03/10/Matlab%20filterDesigner%E5%B7%A5%E5%85%B7%E7%94%9F%E6%88%90FIR%E6%BB%A4%E6%B3%A2%E5%99%A8/" class="post-meta-item leancloud_visitors" data-flag-title="Matlab filterDesigner工具生成FIR滤波器" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/10/Matlab%20filterDesigner%E5%B7%A5%E5%85%B7%E7%94%9F%E6%88%90FIR%E6%BB%A4%E6%B3%A2%E5%99%A8/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/10/Matlab%20filterDesigner%E5%B7%A5%E5%85%B7%E7%94%9F%E6%88%90FIR%E6%BB%A4%E6%B3%A2%E5%99%A8/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        参考资料原文链接：<a target="_blank" rel="noopener" href="https://blog.csdn.net/luobluesky/article/details/89143608">https://blog.csdn.net/luobluesky/article/details/89143608</a></p>
<p>​        在matlab命令窗口输入：<strong>filterDesigner</strong>命令，即可打开filterDesigner设计工具。按照下图调整FIR低通滤波器的参数：设计的是采样频率100Hz，截止频率10Hz的16阶FIR低通数字滤波器。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203102200274.png" style="zoom:70%;">

<p>可以看到上面的Window选择的是Rectangular，然后就出现了这些讨厌的旁瓣。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203102202603.png" style="zoom:70%;">

<p>我们可以改进的方法是通过改用汉明窗试试，如下图所示，明显改善了很多。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203102206022.png" style="zoom:65%;">

<p>我们再看一下它的impulse response：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203102215842.png" style="zoom:67%;">

<p>这个上面就可以得到一组权重系数，另外这个系数也可以直接选出来看的，如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202203102220148.png" style="zoom:67%;">

<p>这些系数可以导出，File–&gt;Export，打开导出数据对话框，我这里选择导出到Workspace，导出为Coefficients即可。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/16/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/16/">16</a><span class="page-number current">17</span><a class="page-number" href="/page/18/">18</a><span class="space">&hellip;</span><a class="page-number" href="/page/29/">29</a><a class="extend next" rel="next" href="/page/18/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
